package com.online.shopping.controller;

import com.online.shopping.service.ItemSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

@RestController
@RequestMapping("/search_Ms")
public class SearchController {

	@Autowired
	private ItemSearchService itemSearchService;

	@GetMapping("/findAll")
	public Map findAll(){
		System.out.println("------------进入findAll------------");
		return itemSearchService.findAll();
	}

	@RequestMapping("/search")
	public Map search(@RequestBody Map searchMap){
		System.out.println("------------进入search------------");
		System.out.println(searchMap.get("keywords"));

		return itemSearchService.search(searchMap);
	}
}
